package com.may.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.may.demo.mapper.OrderMapper;
import com.may.demo.pojo.Order;
import com.may.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: demo
 * @description:
 * @author: Bobby.Ma
 * @create: 2020-11-14 13:46
 **/
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> getOrderList() {
        return orderMapper.selectList(null);
    }

    @Override
    public Integer saveOrder(Order order) {
        return orderMapper.insert(order);
    }

    @Override
    public Integer updateOrder(Order order) {
        return orderMapper.updateById(order);
    }

    @Override
    public Integer deleteOrder(Integer id) {
        return orderMapper.deleteById(id);
    }

    @Override
    public Order getOrder(Integer id) {
        return orderMapper.selectById(id);
    }
}
